﻿<%@ Page Title="Blog Manager" Language="C#" MasterPageFile="~/System/System.master" AutoEventWireup="true" CodeFile="BlogManager.aspx.cs" Inherits="System_Pages_Content_BlogManager" %>
<%@ Register Src="~/System/Controls/FieldTemplates/SinglelineText.ascx" TagPrefix="ucc" TagName="SinglelineText" %>
<%@ Register Src="~/System/Controls/FieldTemplates/MultilineText.ascx" TagPrefix="ucc" TagName="MultilineText" %>
<%@ Register Src="~/System/Controls/FieldTemplates/MessageText.ascx" TagPrefix="ucc" TagName="MessageText" %>
<%@ Register Src="~/System/Controls/FieldTemplates/Boolean.ascx" TagPrefix="ucc" TagName="Boolean" %>
<%@ Register Src="~/System/Controls/FieldTemplates/HyperLink.ascx" TagPrefix="ucc" TagName="HyperLink" %>
<%@ Register Src="~/System/Controls/FieldTemplates/RichText.ascx" TagPrefix="ucc" TagName="RichText" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="SiteFox_Left" Runat="Server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="SiteFox_Title" Runat="Server">
    <asp:Label ID="lab_Title" runat="server" CssClass="content-header-title" Text="<%$ Resources:dcCommon, dc_BlogManager %>" />
    <asp:UpdatePanel ID="up_Title" runat="server" class="content-header-actions">
        <ContentTemplate>
            <asp:ImageButton ID="imb_Blog_Add" runat="server" ImageUrl="~/System/Design/ico/24x24/book_blue_new.png" onclick="imb_Blog_Add_Click" ToolTip="<%$ Resources:dcCommon, dc_CreateNewBlog %>" />
        </ContentTemplate>
    </asp:UpdatePanel>
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="SiteFox_Main" Runat="Server">
    <asp:UpdatePanel ID="up_QuickLinks" runat="server">
        <ContentTemplate>
            <asp:GridView ID="gv_Blog" runat="server" CssClass="gridview" AutoGenerateColumns="false" RowStyle-CssClass="gridview-row" SelectedRowStyle-CssClass="gridview-selectedrow" ShowHeader="true" 
                GridLines="None" HeaderStyle-CssClass="gridview-header">
                <Columns>
                    <asp:BoundField DataField="Name" HeaderText="<%$ Resources:dcCommon, dc_Name %>" HeaderStyle-HorizontalAlign="Left" />
                    <asp:BoundField DataField="Created" HeaderText="<%$ Resources:dcCommon, dc_Created %>" HeaderStyle-HorizontalAlign="Left" />
                    <asp:BoundField DataField="CreatedBy" HeaderText="<%$ Resources:dcCommon, dc_CreatedBy %>" HeaderStyle-HorizontalAlign="Left" />
                    <asp:BoundField DataField="Modified" HeaderText="<%$ Resources:dcCommon, dc_Modified %>" HeaderStyle-HorizontalAlign="Left" />
                    <asp:BoundField DataField="ModifiedBy" HeaderText="<%$ Resources:dcCommon, dc_ModifiedBy %>" HeaderStyle-HorizontalAlign="Left" />
                    <asp:TemplateField>
                        <ItemTemplate>
                            <asp:LinkButton ID="lib_Blog_Posts" runat="server" OnClick="lib_Blog_Posts_Click" CssClass="gridview-btn-posts" CommandArgument='<%# Eval("ID") %>' ToolTip="<%$ Resources:dcCommon, dc_ViewPosts %>" />
                            <asp:LinkButton ID="lib_Blog_Edit" runat="server" OnClick="lib_Blog_Edit_Click" CssClass="gridview-btn-edit" CommandArgument='<%# Eval("ID") %>' ToolTip="<%$ Resources:dcCommon, dc_Edit %>" />
                            <asp:LinkButton ID="lib_Blog_Delete" runat="server" OnClick="lib_Blog_Delete_Click" CssClass="gridview-btn-delete" CommandArgument='<%# Eval("ID") %>' ToolTip="<%$ Resources:dcCommon, dc_Delete %>" />
                        </ItemTemplate>
                    </asp:TemplateField>
                </Columns>
            </asp:GridView>
            <asp:HiddenField ID="hf_Blog_SelectedId" runat="server" />
            <asp:Panel ID="pan_Background" runat="server" CssClass="background" Visible="false"></asp:Panel>
            <asp:Panel ID="pan_Blog_AddOrEdit" runat="server" CssClass="actionpanel" Visible="false">
                <div class="actionpanel-header">
                    <asp:Label ID="lab_Blog_AddOrEdit_Title" runat="server" />
                    <asp:LinkButton ID="lib_Blog_AddOrEdit_Close" runat="server" CssClass="actionpanel-header-close" onclick="lib_Blog_AddOrEdit_Close_Click" />
                </div>
                <div class="actionpanel-content">
                    <ucc:SinglelineText ID="ucc_Blog_AddOrEdit_Name" runat="server" IsReq="true" ReadOnly="false" Title="<%$ Resources:dcCommon, dc_Name %>" ValueMaxLength="50" />
                    <ucc:MultilineText ID="ucc_Blog_AddOrEdit_Description" runat="server" IsReq="false" Title="<%$ Resources:dcCommon, dc_Description %>" ValueRows="4" />
                    <div class="FieldTemplates_Row">
                        <asp:Label ID="lab_Blog_AddOrEdit_Categories_Title" runat="server" CssClass="Label" Text="<%$ Resources:dcCommon, dc_Categories %>" />
                        <asp:ListBox ID="lsb_Blog_AddOrEdit_Categories_Value" runat="server" Width="255px" CssClass="ListBox" />
                        <asp:LinkButton ID="lib_Blog_AddOrEdit_Categories_Add" runat="server" CssClass="LinkButton2" Text="<%$ Resources:dcCommon, dc_Add %>" onclick="lib_Blog_AddOrEdit_Categories_Add_Click" />
                        <asp:LinkButton ID="lib_Blog_AddOrEdit_Categories_Edit" runat="server" CssClass="LinkButton2" Text="<%$ Resources:dcCommon, dc_Edit %>" onclick="lib_Blog_AddOrEdit_Categories_Edit_Click" />
                        <asp:LinkButton ID="lib_Blog_AddOrEdit_Categories_Delete" runat="server" CssClass="LinkButton2" Text="<%$ Resources:dcCommon, dc_Delete %>" onclick="lib_Blog_AddOrEdit_Categories_Delete_Click" />
                    </div>
                    <asp:Panel ID="pan_Blog_AddOrEdit_Categories_AddOrEdit" runat="server" CssClass="FieldTemplates_Row" Visible="false">
                        <span class="Label">&nbsp</span>
                        <asp:TextBox ID="tb_Blog_AddOrEdit_Categories_AddOrEdit_Value" runat="server" CssClass="TextBox" Width="250px" />
                        <asp:RequiredFieldValidator ID="rfv_Blog_AddOrEdit_Categories_AddOrEdit_Value" runat="server" CssClass="RequiredFieldValidator" 
                            Text="*" ErrorMessage="*" ControlToValidate="tb_Blog_AddOrEdit_Categories_AddOrEdit_Value" />
                        <asp:LinkButton ID="lib_Blog_AddOrEdit_Categories_AddOrEdit_Ok" runat="server" CssClass="LinkButton2" Text="<%$ Resources:dcCommon, dc_Ok %>" onclick="lib_Blog_AddOrEdit_Categories_AddOrEdit_Ok_Click" />
                        <asp:LinkButton ID="lib_Blog_AddOrEdit_Categories_AddOrEdit_Cancel" runat="server" CssClass="LinkButton2" Text="<%$ Resources:dcCommon, dc_Cancel %>" onclick="lib_Blog_AddOrEdit_Categories_AddOrEdit_Cancel_Click" />
                    </asp:Panel>
                    <ucc:MessageText ID="ucc_Blog_AddOrEdit_Message" runat="server" />
                    <asp:LinkButton ID="lib_Blog_AddOrEdit_Ok" runat="server" CssClass="LinkButton" ValidationGroup="mainValGroup" onclick="lib_Blog_AddOrEdit_Ok_Click" />
                </div>
            </asp:Panel>
            <asp:Panel ID="pan_Blog_Delete" runat="server" CssClass="actionpanel" Visible="false">
                <div class="actionpanel-header">
                    <asp:Label ID="lab_Blog_Delete_Title" runat="server" Text="<%$ Resources:dcCommon, dc_Delete %>" />
                    <asp:LinkButton ID="lib_Blog_Delete_Close" runat="server" CssClass="actionpanel-header-close" onclick="lib_Blog_Delete_Close_Click" />
                </div>
                <div class="actionpanel-content">
                    <ucc:MessageText ID="ucc_Blog_Delete_Text" runat="server" Title="" Value="<%$ Resources:dcCommon, dc_ConfirmDeleting %>" />
                    <asp:LinkButton ID="lib_Blog_Delete_Ok" runat="server" CssClass="LinkButton" Text="<%$ Resources:dcCommon, dc_Confirm %>" ValidationGroup="mainValGroup" onclick="lib_Blog_Delete_Ok_Click" />
                </div>
            </asp:Panel>

            <asp:Panel ID="pan_BlogPost_Title" runat="server" CssClass="FormTitle" Visible="false">
                <asp:Image ID="img_BlogPost_Title" runat="server" ImageUrl="~/System/Design/ico/32x32/note.png" />
                <asp:Label ID="lab_BlogPost_Title" runat="server" />
                <asp:UpdatePanel ID="up_BlogPost_Title" runat="server">
                    <ContentTemplate>
                        <asp:ImageButton ID="imb_BlogPost_Add" runat="server" ImageUrl="~/System/Design/ico/24x24/note_new.png" 
                            onclick="imb_BlogPost_Add_Click" CssClass="ActionButton" ToolTip="<%$ Resources:dcCommon, dc_CreateNewPost %>" />
                    </ContentTemplate>
                </asp:UpdatePanel>
            </asp:Panel>
            <asp:GridView ID="gv_BlogPost" runat="server" CssClass="gridview" AutoGenerateColumns="false" RowStyle-CssClass="gridview-row" SelectedRowStyle-CssClass="gridview-selectedrow" ShowHeader="true" 
                GridLines="None" HeaderStyle-CssClass="gridview-header">
                <Columns>
                    <asp:BoundField DataField="Title" HeaderText="<%$ Resources:dcCommon, dc_Title %>" HeaderStyle-HorizontalAlign="Left" />
                    <asp:BoundField DataField="Created" HeaderText="<%$ Resources:dcCommon, dc_Created %>" HeaderStyle-HorizontalAlign="Left" />
                    <asp:BoundField DataField="CreatedBy" HeaderText="<%$ Resources:dcCommon, dc_CreatedBy %>" HeaderStyle-HorizontalAlign="Left" />
                    <asp:BoundField DataField="Modified" HeaderText="<%$ Resources:dcCommon, dc_Modified %>" HeaderStyle-HorizontalAlign="Left" />
                    <asp:BoundField DataField="ModifiedBy" HeaderText="<%$ Resources:dcCommon, dc_ModifiedBy %>" HeaderStyle-HorizontalAlign="Left" />
                    <asp:TemplateField ItemStyle-HorizontalAlign="Right" ItemStyle-Width="80px">
                        <ItemTemplate>  
                            <asp:LinkButton ID="lib_BlogPost_Edit" runat="server" OnClick="lib_BlogPost_Edit_Click" CommandArgument='<%# Eval("ID") %>' ToolTip="<%$ Resources:dcCommon, dc_Edit %>" />
                            <asp:LinkButton ID="lib_BlogPost_Delete" runat="server" OnClick="lib_BlogPost_Delete_Click" CommandArgument='<%# Eval("ID") %>' ToolTip="<%$ Resources:dcCommon, dc_Delete %>" />
                        </ItemTemplate>
                    </asp:TemplateField>
                </Columns>
            </asp:GridView>
            <asp:Panel ID="pan_BlogPost_AddOrEdit" runat="server" CssClass="actionpanel" Visible="false">
                <div class="actionpanel-header">
                    <asp:Label ID="lab_BlogPost_AddOrEdit_Title" runat="server" />
                    <asp:LinkButton ID="lib_BlogPost_AddOrEdit_Close" runat="server" CssClass="actionpanel-header-close" onclick="lib_BlogPost_AddOrEdit_Close_Click" />
                </div>
                <div class="actionpanel-content">
                    <ucc:SinglelineText ID="ucc_BlogPost_AddOrEdit_Title" runat="server" IsReq="true" ReadOnly="false" Title="<%$ Resources:dcCommon, dc_Title %>" ValueMaxLength="50" />
                    <div class="FieldTemplates_Row">
                        <asp:Label ID="lab_BlogPost_AddOrEdit_Category_Title" runat="server" Text="<%$ Resources:dcCommon, dc_Category %>" CssClass="Label" />
                        <asp:DropDownList ID="ddl_BlogPost_AddOrEdit_Cateogry_Value" runat="server" CssClass="DropDownList" />
                    </div>
                    <ucc:RichText ID="ucc_BlogPost_AddOrEdit_Description" runat="server" Title="<%$ Resources:dcCommon, dc_Description %>" />
                    <ucc:RichText ID="ucc_BlogPost_AddOrEdit_Text" runat="server" Title="<%$ Resources:dcCommon, dc_Text %>" />
                    <asp:LinkButton ID="lib_BlogPost_AddOrEdit_Ok" runat="server" CssClass="LinkButton" ValidationGroup="mainValGroup" onclick="lib_BlogPost_AddOrEdit_Ok_Click" />
                </div>
                <asp:HiddenField ID="hf_BlogPost_AddOrEdit_Id" runat="server" />
            </asp:Panel>
            <asp:Panel ID="pan_BlogPost_Delete" runat="server" Visible="false">
                <div class="ActionPanel_Background"></div>
                <div class="ActionPanel">
                    <div class="ActionPanel_Header">
                        <asp:Label ID="lab_BlogPost_Delete_Title" runat="server" Text="<%$ Resources:dcCommon, dc_Delete %>" />
                        <asp:ImageButton ID="imb_BlogPost_Delete_Close" runat="server" CssClass="ActionPanel_Close" ImageUrl="~/System/Design/ico/24x24/delete.png" onclick="imb_BlogPost_Delete_Close_Click" />
                    </div>
                    <div class="ActionPanel_Content">
                        <ucc:MessageText ID="ucc_BlogPost_Delete_Text" runat="server" Title="" Value="<%$ Resources:dcCommon, dc_ConfirmDeleting %>" />
                        <asp:LinkButton ID="lib_BlogPost_Delete_Ok" runat="server" CssClass="LinkButton" Text="<%$ Resources:dcCommon, dc_Confirm %>" ValidationGroup="mainValGroup" 
                            onclick="lib_BlogPost_Delete_Ok_Click" />
                        <asp:HiddenField ID="hf_BlogPost_Delete_Id" runat="server" />
                    </div>
                </div>
            </asp:Panel>
        </ContentTemplate>
    </asp:UpdatePanel>
</asp:Content>